home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / generic / interr.lisp < prev    next >
Encoding:
Text File  |  1992-05-21  |  4.8 KB  |  156 lines

  1. ;;; -*- Package: KERNEL -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: interr.lisp,v 1.2 92/03/22 17:30:26 wlott Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;; This file defines all of the internal errors.  How they are handled is
  15. ;;; defined in .../code/interr.lisp.  How they are signaled depends on the
  16. ;;; machine.
  17. ;;; 
  18. ;;; Written by William Lott.
  19. ;;;
  20. (in-package "KERNEL")
  21.  
  22. (export '(error-number-or-lose))
  23.  
  24.  
  25. (defun error-number-or-lose (name)
  26.   (or (position name (c:backend-internal-errors c:*backend*) :key #'car)
  27.       (error "Unknown internal error: ~S" name)))
  28.  
  29.  
  30. (eval-when (compile eval)
  31.  
  32. (defmacro define-internal-errors (&rest errors)
  33.   (let ((info (mapcar #'(lambda (x)
  34.               (if x
  35.                   (cons (symbolicate (first x) "-ERROR")
  36.                     (second x))
  37.                   '(nil . "unused")))
  38.               errors)))
  39.     `(progn
  40.        (export ',(remove nil (mapcar #'car info)))
  41.        (setf (c:backend-internal-errors c:*target-backend*)
  42.          ',(coerce info 'vector))
  43.        nil)))
  44.  
  45. ); eval-when
  46.  
  47.  
  48. (define-internal-errors
  49.   (unknown
  50.    "Unknown.  System lossage.")
  51.   (object-not-function
  52.    "Object is not of type FUNCTION.")
  53.   (object-not-list
  54.    "Object is not of type LIST.")
  55.   (object-not-bignum
  56.    "Object is not of type BIGNUM.")
  57.   (object-not-ratio
  58.    "Object is not of type RATIO.")
  59.   (object-not-single-float
  60.    "Object is not of type SINGLE-FLOAT.")
  61.   (object-not-double-float
  62.    "Object is not of type DOUBLE-FLOAT.")
  63.   (object-not-simple-string
  64.    "Object is not of type SIMPLE-STRING.")
  65.   (object-not-simple-bit-vector
  66.    "Object is not of type SIMPLE-BIT-VECTOR.")
  67.   (object-not-simple-vector
  68.    "Object is not of type SIMPLE-VECTOR.")
  69.   (object-not-fixnum
  70.    "Object is not of type FIXNUM.")
  71.   (object-not-function-or-symbol
  72.    "Object is not of type FUNCTION or SYMBOL.")
  73.   (object-not-vector
  74.    "Object is not of type VECTOR.")
  75.   (object-not-string
  76.    "Object is not of type STRING.")
  77.   (object-not-bit-vector
  78.    "Object is not of type BIT-VECTOR.")
  79.   (object-not-array
  80.    "Object is not of type ARRAY.")
  81.   (object-not-number
  82.    "Object is not of type NUMBER.")
  83.   (object-not-rational
  84.    "Object is not of type RATIONAL.")
  85.   (object-not-float
  86.    "Object is not of type FLOAT.")
  87.   (object-not-real
  88.    "Object is not of type REAL.")
  89.   (object-not-integer
  90.    "Object is not of type INTEGER.")
  91.   (object-not-cons
  92.    "Object is not of type CONS.")
  93.   (object-not-symbol
  94.    "Object is not of type SYMBOL.")
  95.   (undefined-symbol
  96.    "Undefined symbol.")
  97.   (object-not-coercable-to-function
  98.    "Object is not coercable to type FUNCTION.")
  99.   (invalid-argument-count
  100.    "Invalid argument count.")
  101.   (bogus-argument-to-values-list
  102.    "Bogus argument to VALUES-LIST.")
  103.   (unbound-symbol
  104.    "Unbound symbol.")
  105.   nil
  106.   (object-not-sap
  107.    "Object is not a System Area Pointer (SAP).")
  108.   (invalid-unwind
  109.    "Attempt to RETURN-FROM a block that no longer exists.")
  110.   (unseen-throw-tag
  111.    "Attempt to THROW to a non-existent tag.")
  112.   (division-by-zero
  113.    "Attempt to divide by zero.")
  114.   (object-not-type
  115.    "Object is of the wrong type.")
  116.   (odd-keyword-arguments
  117.    "Odd number of keyword arguments.")
  118.   (unknown-keyword-argument
  119.    "Unknown keyword.")
  120.   nil
  121.   nil
  122.   (invalid-array-index
  123.    "Invalid array index.")
  124.   (wrong-number-of-indices
  125.    "Wrong number of indices.")
  126.   (object-not-simple-array
  127.    "Object is not of type SIMPLE-ARRAY.")
  128.   (object-not-signed-byte-32
  129.    "Object is not of type (SIGNED-BYTE 32).")
  130.   (object-not-unsigned-byte-32
  131.    "Object is not of type (UNSIGNED-BYTE 32).")
  132.   (object-not-simple-array-unsigned-byte-2
  133.    "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 2) (*)).")
  134.   (object-not-simple-array-unsigned-byte-4
  135.    "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 4) (*)).")
  136.   (object-not-simple-array-unsigned-byte-8
  137.    "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*)).")
  138.   (object-not-simple-array-unsigned-byte-16
  139.    "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 16) (*)).")
  140.   (object-not-simple-array-unsigned-byte-32
  141.    "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 32) (*)).")
  142.   (object-not-simple-array-single-float
  143.    "Object is not of type (SIMPLE-ARRAY SINGLE-FLOAT (*)).")
  144.   (object-not-simple-array-double-float
  145.    "Object is not of type (SIMPLE-ARRAY DOUBLE-FLOAT (*)).")
  146.   (object-not-complex
  147.    "Object is not of type COMPLEX.")
  148.   (object-not-weak-pointer
  149.    "Object is not a WEAK-POINTER.")
  150.   (object-not-structure
  151.    "Object is not a STRUCTURE.")
  152.   (object-not-base-char
  153.    "Object is not of type BASE-CHAR.")
  154.   (nil-function-returned
  155.    "Function with declared result type NIL returned."))
  156.